<template>
  <!--编辑沸点弹出层-->
  <div id="hot" v-show="$store.state.hotBoxOpen">
    <!--编辑框-->
    <div class="hotbox">
      <div class="qlog-head">
        <span>发沸点</span>
        <a href="#" @click="$store.commit('changHotBoxOpen')"><i class="el-icon-close"></i></a>
      </div>
      <el-input
          type="textarea"
          autosize
          placeholder="快和掘友一起分享新鲜事！告诉你个小秘密，发布沸点时添加圈子和话题会被更多掘友看到哦~"
          maxlength="1000"
          show-word-limit
          id="hot-input"
          v-model="form.hotword">
      </el-input>
      <div class="hot-foot">
        <div class="hot-foot-left">
              <ul>
                <li>
                  <i class="el-icon-sugar"></i>
                  <span>表情</span>
                </li>
                <li>
                  <i class="el-icon-picture-outline"></i>
                  <span>图片</span>
                </li>
                <li>
                  <i class="el-icon-link"></i>
                  <span>链接</span>
                </li>
                <li>
                  <i class="el-icon-chat-line-square"></i>
                  <span>话题</span>
                </li>
              </ul>
        </div>
        <el-button type="primary" class="hot-commit" @click="commitHot">发布</el-button>
      </div>
    </div>
  </div>
</template>
<script>
import {allUse} from "../requests/apis";
export default {
  name: "hot",
  data(){
    return{
      form: {
        hotword:''
      }
    }
  },
  methods:{
    commitHot(){
      allUse('/api/addModifyArticle','post',{
        type:2,
        info:this.form.hotword,
        tags_name: ['默认tag'],
        token:this.$getSession().token
      }).then(res=>{
        console.log(res)
        if(res.data.code===2000){
          this.$message({
            type:'success',
            message:'发布成功'
          })
          this.$store.commit('changHotBoxOpen')
        }
      }).catch(err=>{
        console.log(err)})
    }
  }
}
</script>

<style>
#hot {
  width: 100vw;
  height: 100vh;
  background-color: #0000009a;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 99;
}

.hotbox {
  width: 590px;
  /*height: 200px;*/
  background-color: #fff;
  position: fixed;
  top: 60px;
  left: calc(50% - 295px);
  border-radius: 2px;
  padding: 25px;
}

.qlog-head a {
  font-size: 24px;
}
#hot-input{
  margin-top: 10px;
  min-height: 130px !important;
  font-size: 14px;
  line-height: 24px;
  color: #252933;
  font-family: "Microsoft YaHei";
  background-color: #F2F3F5;
  border: none;
  resize: none;
}
.hot-foot{
  height: 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.hot-foot-left ul{
  width: 265px;
  display: flex;
  justify-content: space-between;
}
.hot-foot-left ul li{
  color: #4e5969;
  font-size: 14px;
  vertical-align: middle;
  cursor: pointer;
}
.hot-foot-left ul li:hover{
  color: #1E80FF;
}
.hot-foot-left ul li i{
  font-size: 16px;
  margin-right: 3px;
}
.hot-commit{
  width: 90px;
  height: 35px;
}

</style>